Ext.onReady(function(){

	// create the data store
	var store = new Ext.data.JsonStore({
		url: 'data.php',
		fields: [
			'VOZAC_ID',
			'IME', 'PREZIME'
		]
	});

	// load data from the url ( data.php )
	store.load();

	// create the Grid
	var grid = new Ext.grid.GridPanel({
		store: store,
		columns: [
			{header: 'VOZAC_ID', width: 100, sortable: true, dataIndex: 'VOZAC_ID'},
			{header: 'IME', width: 100, sortable: true, dataIndex: 'IME'},
			{header: 'PREZIME', width: 100, sortable: true, dataIndex: 'PREZIME'},
		],
		stripeRows: true,
		height:250,
		width:500,
		title:'DB Grid'
	});

	// render grid
	grid.render('db-grid');

});